<?php

namespace common\validate;

class TaskClock extends BaseValidate
{
    // 验证规则
    protected $rule = [];

    // Fields 验证场景定义
    public function sceneFields()
    {
        return $this;
    }

    public function sceneCreateTaskClock()
    {
        return $this->append('data', 'require|array')
            ->append('data.task_id', 'require|array')
            ->append('data.time', 'require|array');
    }

    public function sceneCreateTaskClockItem()
    {
        return $this->append('task_id', 'require')
            ->append('time', 'require')
            ->append('created_by', 'require');
    }

    public function sceneCloseTaskClock()
    {
        return $this->append('param', 'require')
            ->append('param.filter', 'require');
    }

    public function sceneSelectTaskClock()
    {
        return $this->append('param', 'require')
            ->append('param.filter', 'require')
            ->append('param.filter.task_id', 'require');
    }

    public function sceneSelectTaskClockList()
    {
        return $this->append('param', 'require')
            ->append('param.filter', 'require|array')
            ->append('param.filter.project_id', 'require')
//            ->append('param.filter.step_category_id', 'require')
            ->append('param.page', 'array');
    }

    public function sceneDeleteTaskClock()
    {
        return $this->append('param', 'require')
            ->append('param.filter', 'require|array');
    }
}
